<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改课程管理')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-course-edit" th:object="${eduCourse}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">课程名：</label>
                <div class="col-sm-8">
                    <input name="name" th:field="*{name}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">课程描述：</label>
                <div class="col-sm-8">
                    <input name="note" th:field="*{note}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">学时：</label>
                <div class="col-sm-9">
                    <select class="form-control" name="period">
                        <option value="24" th:field="*{period}">24</option>
                        <option value="32" th:field="*{period}">32</option>
                        <option value="64" th:field="*{period}">64</option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">学分：</label>
                <div class="col-sm-8">
                    <input name="credit" th:field="*{credit}" class="form-control" type="text">
                </div>
            </div>
            <h4 class="form-header h4">其他信息</h4>
            <div class="form-group">
                <label class="col-sm-3 control-label">授课教师：</label>
                <div class="col-sm-9">
                    <select class="form-control" name="teacher.id">
                        <option>请选择</option>
                        <option th:each="teacher: ${teachers}" th:text="${teacher.name}" th:value="${teacher.id}" th:field="*{teacher.id}"></option>
                    </select>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "education/course";
        $("#form-course-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-course-edit').serialize());
            }
        }
    </script>
</body>
</html>